<template>
    <div>
        <comp ref="bar" height="300px" width="100%" />
    </div>
</template>
<script>
import comp from "./index";
export default {
    name: "test",
    title: "背景柱子",
    components: { comp },
    theme: "black",
    data() {
        return {
            dataCols: {
                dimension: ["日期"],
                unit: "元",
                legend: {
                    data: ["类型1", "类型2"],
                },
                series: [
                    {
                        日期: "1-1",
                        类型1: 1,
                        类型2: "20",
                    },
                    {
                        日期: "1-2",
                        类型1: 2,
                        类型2: "21",
                    },
                    {
                        日期: "1-3",
                        类型1: 3,
                        类型2: "22",
                    },
                    {
                        日期: "1-4",
                        类型1: 4,
                        类型2: "23",
                    },
                    {
                        日期: "1-5",
                        类型1: 5,
                        类型2: "24",
                    },
                ],
            },
            setting: {
                // theme: "black",
                grid: {},
                color: [],
                series: {
                    barWidth: "",
                    showBackground: false,
                    backgroundStyle: {
                        barBorderRadius: [0],
                    },
                },
            },
        };
    },
    mounted() {
        this.$nextTick(() => {
            let param = {
                dataCols: this.dataCols,
                setting: this.setting,
            };
            this.$refs.bar.initChart(param);
        });
    },
};
</script>